package com.qd.common.sys.domain.entity.msg;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.qd.common.dict.DictConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 回执表
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class MsgReportDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "日志ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "日志ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String reportId;
    /**
     * 消息ID
     */
    @NotBlank(message = "消息ID不能为空", groups = DefaultGroup.class)
    @Size(max = 64, message = "消息ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgId;
    /**
     * 发送结果:1成功2失败
     */
    @NotNull(message = "发送结果不能为空", groups = DefaultGroup.class)
    @FieldBind(targetField = "sendResultDisplay", processName = DictConstant.SYS_SEND_RESULT)
    private Integer sendResult;
    /**
     * 发送结果显示
     */
    private String sendResultDisplay;
    /**
     * 回执时间
     */
    private LocalDateTime reportTime;
    /**
     * 写入时间
     */
    private LocalDateTime addTime;
    /**
     * 错误码
     */
    @Size(max = 100, message = "错误码长度不能超过{max}位", groups = DefaultGroup.class)
    private String errCode;
    /**
     * 异常信息
     */
    @Size(max = 200, message = "异常信息长度不能超过{max}位", groups = DefaultGroup.class)
    private String errMsg;

    @Override
    public void freeData() {
        this.reportId = null;
        this.msgId = null;
        this.sendResult = null;
        this.sendResultDisplay = null;
        this.reportTime = null;
        this.addTime = null;
        this.errCode = null;
        this.errMsg = null;
        super.freeData();
    }
}
